import { stringify } from 'qs';
import request from '@/utils/request';

import webpath from '@/utils/webpath';

export async function deleteByPrimaryKeyForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/delete?${stringify(params)}`);
}


export async function selectByPrimaryKeyForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/get?${stringify(params)}`);
}


export async function insertForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}


export async function updateForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/update`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function deleteByMapForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/deleteByMap`, {
        method: 'POST',
        data: {
            ...params,
            method: 'delete',
        },
    });
}


export async function updateByMapForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/updateByMap`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function getOneForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/getOne`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}



export async function getAllForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}


export async function queryPageForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/queryPage`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}


export async function countForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/count`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function insertBatchForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/insertBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}


export async function deleteBatchForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/deleteBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'delete',
        },
    });
}


export async function updateBatchForProUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/updateBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}

export async function getProDeptTreeByLevelCode(params = {}) {
    return request(`/${webpath}/web/api/service/prodept/getProDeptTreeByLevelCode`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getProDeptTreeByParentid(params = {}) {
    return request(`/${webpath}/web/api/service/prodept/getProDeptTreeByParentid`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getProOrgTreeByParentid(params = {}) {
    return request(`/${webpath}/web/api/service/proorg/getProOrgTreeByParentid`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getAllAuthForUser(params = {}) {
    return request(`/${webpath}/web/api/service/prouser/getAllAuthForUser`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getAllPostForUser(params = {}) {
    return request(`/${webpath}/web/api/service/post/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function queryPageForPoliceSelect(params = {}) {
    return request(`/${webpath}/web/api/service/policestaffselect/queryPage`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

// export async function queryPageForPoliceSelect(params = {}) {
//     return request(`/${webpath}/web/api/service/management/queryPage`, {
//         method: 'POST',
//         data: {
//             ...params,
//             method: 'fetch',
//         },
//     });
// }

export async function getPoliceRankTreeByParentid(params = {}) {
    return request(`/${webpath}/web/api/service/policestaffselect/getPoliceRankTreeByParentid`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getDutyLevelTreeByParentid(params = {}) {
    return request(`/${webpath}/web/api/service/policestaffselect/getDutyLevelTreeByParentid`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getWorkTreeByParentid(params = {}) {
    return request(`/${webpath}/web/api/service/policestaffselect/getWorkTreeByParentid`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getChangeTypeTreeByParentid(params = {}) {
    return request(`/${webpath}/web/api/service/policestaffselect/getChangeTypeTreeByParentid`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}
